package com.asset.salesforce.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@SuppressWarnings("serial")
@Entity
@Table(name="comment")
public class Comment implements Serializable{

	private Integer id;
	
	private Employee commenter;
	
	private String commentText;
	
	private Date commentDate;
	
	private Post post;
	
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="comment_id_seq")
	@SequenceGenerator(name="comment_id_seq",sequenceName="comment_id_seq",allocationSize=1)
	public Integer getId() {
		return id;
	}
	
	
	public void setId(Integer id) {
		this.id = id;
	}
	@ManyToOne
	@JoinColumn(name="commenter_id")
	public Employee getCommenter() {
		return commenter;
	}

	public void setCommenter(Employee commenter) {
		this.commenter = commenter;
	}
	@Column(name="comment_text")
	public String getCommentText() {
		return commentText;
	}

	public void setCommentText(String commentText) {
		this.commentText = commentText;
	}
	@Column(name="comment_date")
	public Date getCommentDate() {
		return commentDate;
	}

	public void setCommentDate(Date commentDate) {
		this.commentDate = commentDate;
	}

	@ManyToOne
	@JoinColumn(name="post_id")
	public Post getPost() {
		return post;
	}


	public void setPost(Post post) {
		this.post = post;
	}
	
	
	

}